﻿#include "FITKAcousticsMaterialsIsosolid.h"

namespace Acoustics
{
    FITKAcousticsAbsMaterial::AcousticsMaterialType FITKAcousticsMaterialsIsosolid::getAcousticsMaterialType()
    {
        return FITKAcousticsAbsMaterial::AcousticsMaterialType::ISOSolid;
    }
   
    double FITKAcousticsMaterialsIsosolid::getTensileModulus() const
    {
        return _tensileModulus;
    }

    void FITKAcousticsMaterialsIsosolid::setTensileModulus(double tensileModulus)
    {
        _tensileModulus = tensileModulus;
    }

    double FITKAcousticsMaterialsIsosolid::getShearModulus() const
    {
        return _shearModulus;
    }

    void FITKAcousticsMaterialsIsosolid::setShearModulus(double shearModulus)
    {
        _shearModulus = shearModulus;
    }
    
    double FITKAcousticsMaterialsIsosolid::getPoissonRatio() const
    {
        return _poissonRatio;
    }
    
    void FITKAcousticsMaterialsIsosolid::setPoissonRatio(double poissonRatio)
    {
        _poissonRatio = poissonRatio;
    }

    bool FITKAcousticsMaterialsIsosolid::copy(Core::FITKAbstractDataObject *obj)
    {
        //转换强制类型
        Acoustics::FITKAcousticsMaterialsIsosolid* data = dynamic_cast<Acoustics::FITKAcousticsMaterialsIsosolid*>(obj);

        if(nullptr == data)//判断是否转换成功
        {
            return false;
        }
        //复制成员变量
        _tensileModulus = data->getTensileModulus();
        _shearModulus = data->getShearModulus();
        _poissonRatio = data->getPoissonRatio();
        // 调用父类的方法
        Acoustics::FITKAcousticsAbsMaterial::copy(obj);
        return true;
    }
}
